package com.typing.controller;

import com.typing.utils.AccountException;
import com.typing.utils.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
	public class MyExceptionHandler {

	public MyExceptionHandler() {
	}

	    @ExceptionHandler(value = AccountException.class)
		@ResponseBody
		public Result exceptionHandler(AccountException e){
			return new Result().accountError();
		}
	}

